package com.wx.tgp.designpattern.observerPattern;

import com.wx.tgp.designpattern.observerPattern.observer02.SecretartSub;
import com.wx.tgp.designpattern.observerPattern.observer02.Secretary;
import com.wx.tgp.designpattern.observerPattern.observer02.SockerObserver;
import com.wx.tgp.designpattern.observerPattern.observer02.SockerObserverSub;

/**
 * 观察者模式
 */
public class Client {

    public static void main(String[] args) {
        Secretary sub = new Secretary();
        SockerObserver gupiao = new SockerObserver("张三",sub);
        SockerObserver gupiao2 = new SockerObserver("李四",sub);
        sub.addObserver(gupiao);
        sub.addObserver(gupiao2);
        sub.setStatue("胡汉三加来了。");
        sub.notity();
    }
}
